package com.cssy.xxkj.basic.dao.impl;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.basic.dao.BasicCurrencyTestDAO;
import com.cssy.xxkj.basic.entity.BasicCurrencyTestDO;
import com.plat.helper.SearchConditions;

/**
 * 数据访问对象实现类
 * @since 2014-09-02
 */
public class BasicCurrencyTestDAOImpl extends SqlMapClientDaoSupport implements BasicCurrencyTestDAO {

    /**
     * 插入数据
     * @param basicCurrencyTestDO
     * @return 插入数据的主键
     */
    public void insertBasicCurrencyTestDO(BasicCurrencyTestDO basicCurrencyTestDO) throws DataAccessException {
        getSqlMapClientTemplate().insert("BasicCurrencyTest.insert", basicCurrencyTestDO);
    }

    /**
     * 统计记录数
     * @param basicCurrencyTestDO
     * @return 查出的记录数
     */
    public Integer countBasicCurrencyTestDOByExample(BasicCurrencyTestDO basicCurrencyTestDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicCurrencyTest.countByDOExample", basicCurrencyTestDO);
        return count;
    }

    /**
     * 获取对象列表
     * @param basicCurrencyTestDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<BasicCurrencyTestDO> findListByExample(BasicCurrencyTestDO basicCurrencyTestDO) throws DataAccessException {
        List<BasicCurrencyTestDO> list = getSqlMapClientTemplate().queryForList("BasicCurrencyTest.findListByDO", basicCurrencyTestDO);
        return list;
    }

	@Override
	public List<BasicCurrencyTestDO> find(SearchConditions scs)
			throws DataAccessException {
		List<BasicCurrencyTestDO> list = getSqlMapClientTemplate().queryForList("BasicCurrencyTest_ex.find", scs);
        return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicCurrencyTest_ex.count", scs);
        return count;
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicCurrencyTest_ex.deleteBizRemoved", id);
        return count;
	}

	@Override
	public Integer updateBasicCurrencyTestDO(
			BasicCurrencyTestDO basicCurrencyTestDO) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().update("BasicCurrencyTest.update", basicCurrencyTestDO);
        return count;
	}

	@Override
	public BasicCurrencyTestDO findBasicCurrencyTestDOByPrimaryKey(String id)
			throws DataAccessException {
		BasicCurrencyTestDO basicCurrencyTestDO = (BasicCurrencyTestDO) getSqlMapClientTemplate().queryForObject("BasicCurrencyTest.findByPrimaryKey", id);
        return basicCurrencyTestDO;
	}

	@Override
	public Integer deleteBasicCurrencyTestDOByPrimaryKey(String id)
			throws DataAccessException {
		Integer rows = (Integer) getSqlMapClientTemplate().delete("BasicCurrencyTest.deleteByPrimaryKey", id);
        return rows;
	}

}